#define _CRT_SECURE_NO_WARNINGS 1

#include<bits/stdc++.h> 

using namespace std;

int main()
{
    map<string, int> mp;
    int n = 0;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        string tmp;
        cin >> tmp;
        if (mp.count(tmp) == 0)   mp[tmp] = 1;
        else    mp[tmp]++;
    }
    int ans = 0;
    for (auto it = mp.begin(); it != mp.end(); ++it)
    {
        if (ans < it->second)   ans = it->second;
    }
    cout << ans << endl;
    return 0;
}